<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserTrain extends Model
{
    //用戶訓練表
    protected $table = 'user_train';

    public function class_base(){
        return $this->belongsTo(ClassBase::class,'class_base_id','id');
    }

    public function store(){
        return $this->belongsTo(Store::class,'store_id','id');
    }

    public function classroom(){
        return $this->belongsTo(Classroom::class,'class_classroom_id','id');
    }

    public function class_base_info(){
        return $this->belongsTo(ClassBaseInfo::class,'class_base_info_id','id');
    }

    //老师
    public function teacher()
    {
        return $this->hasOne('App\Models\Teacher','id','teacher_id');
    }

}
